Method and device for color similarity evaluation

ABSTRACT

Method and device configured for color similarity evaluation between a first and a second color, comprising the steps of: calculating one or more filters from said first and second colors; determining that the first and second colors are dissimilar if at least one of the calculated filters is above a threshold predetermined for each filter; otherwise, calculating the CIEDE2000 color-difference and determining that the first and second colors are dissimilar if the calculated CIEDE2000 color-difference is above a predetermined threshold; otherwise, determining that they are similar. A module filter may calculate the module of the difference vector between the first and second colors represented as 3D coordinates in the RGB color space, the angle between the two vectors of the first and second colors represented as 3D coordinates in the RGB color space, or the lightness difference between the first and second colors in the CIELAB color space.

TECHNICAL FIELD

The present disclosure relates to a method and device for color similarity evaluation, namely comparing two colors, applicable to areas such as digital image processing or computer vision.

BACKGROUND

Color differences are of great importance in many applications, particularly when image processing or computer vision techniques are to be employed. Examples of such application topics are mineral identification, dental ceramics, wine color analysis, corrosion detection and, in a more generic field, image segmentation. The latter is widely used and often a critical step in image and video processing algorithms. The noise in the outcome of this step affects the results of the following processing, namely in segmentation, detection or appearance matching, possibly preventing a proper operation. Despite the many years of research, image segmentation is still an unresolved research topic, with color identification playing a key role. The CIEDE2000 [3] metric was recommended by CIE in 2000 for industrial color difference evaluation. However, its benefits have been impaired by the computational cost.

The CIEDE2000 [3] formulation has been as an international standard since 2014, which hereby is incorporated by reference in its entirety and in particular in its calculation of color differences, with reference ISO CIE 11664-6:2014 (CIE S 014-6/E:2013), and has a strong focus on industry applications. This metric has been receiving increased attention, showing high potential in discriminating between colors, especially those with higher similarity. Using the CIEDE2000 [3] metric (ΔE₀₀) allows to quantify how humans perceive the difference between two colors. Nevertheless, its wider usage has been impaired due to the high computation cost, which prevents its application in many scenarios, particularly those with real time constraints.

Even though the technological evolution has enabled higher computation capabilities, there is a large number of scenarios that remain unfeasible due to the high quantities of visual information or restricted hardware.

Color based algorithms can be severely affected by illumination and the discrimination between closer colors is rarely easy. The CIEDE2000 metric has been increasingly used in many applications, enabling a coarser or finer discrimination based on the metric threshold that is selected. The ΔE₀₀ color difference formula was designed so as to characterize the perceptual color difference that humans have and can be summarized by equations 1 to 28:

$\begin{matrix} {{\Delta\; E_{00}} = \sqrt{t_{1}^{2} + t_{2}^{2} + t_{3}^{2} + {R_{T} \times t_{2} \times t_{3}}}} & (1) \\ {t_{1} = \left( \frac{\Delta\; L^{\prime}}{K_{L}S_{L}} \right)} & (2) \\ {t_{2} = \left( \frac{\Delta\; C^{\prime}}{K_{C}S_{C}} \right)} & (3) \\ {t_{3} = \left( \frac{\Delta\; H^{\prime}}{K_{H}S_{H}} \right)} & (4) \\ {C_{1} = \sqrt{a_{1}^{2} + b_{1}^{2}}} & (5) \\ {C_{2} = \sqrt{a_{2}^{2} + b_{2}^{2}}} & (6) \\ {{\overset{\_}{L}}^{\prime} = \frac{L_{1} + L_{2}}{2}} & (7) \\ {\overset{\_}{C} = \frac{C_{1} + C_{2}}{2}} & (8) \\ {G = \frac{1 - \sqrt{\frac{{\overset{\_}{C}}^{7}}{{\overset{\_}{C}}^{7} + 25^{7}}}}{2}} & (9) \\ {a_{1^{\prime}} = {a_{1}\left( {1 + G} \right)}} & (20) \\ {a_{2^{\prime}} = {a_{2}\left( {1 + G} \right)}} & (31) \\ {C_{1^{\prime}} = \sqrt{a_{1^{\prime}}^{2} + b_{1^{\prime}}^{2}}} & (42) \\ {C_{2^{\prime}} = \sqrt{a_{2^{\prime}}^{2} + b_{2^{\prime}}^{2}}} & (53) \\ {{\overset{\_}{C}}^{\prime} = \frac{C_{1^{\prime}} + C_{2^{\prime}}}{2}} & (64) \\ {h_{1^{\prime}} = \left( \begin{matrix} {{{\tan^{- 1}\left( \frac{b_{1}}{a_{1^{\prime}}} \right)}{if}\;{\tan^{- 1}\left( \frac{b_{1}}{a_{1^{\prime}}} \right)}} \geq 0} \\ {{\tan^{- 1}\left( \frac{b_{1}}{a_{1^{\prime}}} \right)} + {360{{^\circ}otherwise}}} \end{matrix} \right.} & (75) \\ {h_{2^{\prime}} = \left( \begin{matrix} {{{\tan^{- 1}\left( \frac{b_{2}}{a_{2^{\prime}}} \right)}{if}\;{\tan^{- 1}\left( \frac{b_{2}}{a_{2^{\prime}}} \right)}} \geq 0} \\ {{\tan^{- 1}\left( \frac{b_{2}}{a_{2^{\prime}}} \right)} + {360{{^\circ}otherwise}}} \end{matrix} \right.} & (86) \\ {{\overset{\_}{H}}^{\prime} = \left( \begin{matrix} {{\frac{h_{1^{\prime}} + h_{2^{\prime}} + {360{^\circ}}}{2}{if}{{h_{1^{\prime}} + h_{2^{\prime}}}}} > {180{^\circ}}} \\ {{\frac{h_{1^{\prime}} + h_{2^{\prime}}}{2}{otherwise}}} \end{matrix} \right.} & (97) \\ {T = {1 - {0.17{\cos\left( {{\overset{\_}{H}}^{\prime} - 30} \right)}} + {0.24{\cos\left( {2{\overset{\_}{H}}^{\prime}} \right)}} + {0.32{\cos\left( {{3{\overset{\_}{H}}^{\prime}} + 6} \right)}} - {0.2{\cos\left( {{4{\overset{\_}{H}}^{\prime}} - 63} \right)}}}} & (108) \\ {{\Delta\; h^{\prime}} = \left( \begin{matrix} {{{h_{2^{\prime}} - {h_{1^{\prime}}{if}{{h_{2^{\prime}} - h_{1^{\prime}}}}}} \leq {180{^\circ}}}\mspace{160mu}} \\ {{{h_{2^{\prime}} - h_{1^{\prime}} + {360{if}{{h_{2^{\prime}} - h_{1^{\prime}}}}}} > 180};{h_{2^{\prime}} \leq h_{1^{\prime}}}} \\ {{{h_{2^{\prime}} - h_{1^{\prime}} - {360{if}{{h_{2^{\prime}} - h_{1^{\prime}}}}}} > 180};{h_{2^{\prime}} > h_{1^{\prime}}}} \end{matrix} \right.} & (119) \\ {{\Delta\; L^{\prime}} = {L_{2} - L_{1}}} & (20) \\ {{\Delta\; C^{\prime}} = {C_{2^{\prime}} - C_{1^{\prime}}}} & (21) \\ {{\Delta\; H^{\prime}} = {2\sqrt{C_{1^{\prime}}C_{2^{\prime}}}{\sin\left( \frac{\Delta\; h^{\prime}}{2} \right)}}} & (22) \\ {S_{L} = {1 + \frac{0.015\left( {{\overset{\_}{L}}^{\prime} - 50} \right)^{2}}{\sqrt{20 + \left( {{\overset{\_}{L}}^{\prime} - 50} \right)^{2}}}}} & (23) \\ {S_{C} = {1 + {0.045{\overset{\_}{C}}^{\prime}}}} & (24) \\ {S_{H} = {1 + {0.015{\overset{\_}{C}}^{\prime}T}}} & (25) \\ {R_{T} = {{- R_{C}}{\sin\left( {2{\Delta\theta}} \right)}}} & (26) \\ {R_{C} = {2\sqrt{\frac{{\overset{\_}{C}}^{\prime 7}}{{\overset{\_}{C}}^{\prime 7} + 25^{7}}}}} & (27) \\ {{{\Delta\theta} = {30\exp\left\{ {- \left( \frac{{\overset{\_}{H}}^{\prime} - 275}{25} \right)^{2}} \right\}}},} & (28) \end{matrix}$

where K_(L), K_(C) and K_(H) are correction factors related to Lightness, Chroma and Hue, respectively. In our experiments these values were set to 1 as defined in the CIE standard. The S_(L), S_(C) and S_(H) parameters are weighting factors; ΔL′, ΔC′ and ΔH′ are the Lightness, Chroma and Hue differences. L₁, a₁, b₁ and L₂, a₂, b₂ are two colors in the CIELAB color space, with ISO 11664-4:2008 (CIE S 014-4/E:2007).

The edge detection methodology presented in [4] combined edge maps from different sources in order to upscale depth information with limited spatial resolution. Some alternatives were shown and the one that provided the best results was comprised of a combination of edge maps for intensity and color difference. The color difference edge map was obtained by usage of the CIEDE2000 color difference, in order to obtain a perceptual color edge detection that follows the characteristics of the human visual system. Although this solution provided the best results, it had the cost of a high computational complexity. For color similarity decisions using ΔE₀₀, values equal or bellow 3 are typically applied; for values above 10, two colors are considered to be very different.

The CIEDE2000 [3] metric has other concurrent metrics, namely other metrics proposed by CIE like, CIE76 (also know as DeltaE CIELAB), CIE94 and DeltaE CMC. Nevertheless, several studies have concluded that more robust results can be obtained by employing ΔE₀₀ even with the default parameters. Better results may be obtained by tuning formula factors to a given application characteristics.

These facts are disclosed in order to illustrate the technical problem addressed by the present disclosure.

REFERENCES

-   [1] Griffin, Gregory and Holub, Alex and Perona, Pietro. Caltech-256     object category dataset. 2007. -   [2] Liaw, Andy and Wiener, Matthew. Classification and regression by     randomForest. R news, 2(3):18-22, 2002. -   [3] Luo, M Ronnier and Cui, Guihua and Rigg, B. The development of     the CIE 2000 colour-difference formula: CIEDE2000. Color Research &     Application, 26(5):340-350, 2001. -   [4] Schwarz, Sebastian and Sjöström, Mårten and Olsson, Roger.     Improved edge detection for EWOC depth upscaling. 2012 19th     International Conference on Systems, Signals and Image Processing     (IWSSIP), pages 1-4, 2012. IEEE. -   [5] Color Names Supported by All Browsers.     http://www.w3schools.com/colors/colors_names.asp. [Online; accessed     08-04-2016]. -   [6] Dang-Nguyen, Duc-Tien and Pasquini, Cecilia and Conotter,     Valentina and Boato, Giulia. RAISE: a raw images dataset for digital     image forensics. Proceedings of the 6th ACM Multimedia Systems     Conference, pages 219-224,2015. ACM. -   [7] Pecho, Oscar E and Ghinea, Razvan and Alessandretti, Rodrigo and     Perez, Mara M and Della Bona, Alvaro. Visual and instrumental shade     matching using CIELAB and CIEDE2000 color difference formulas.     Dental Materials, 32(1):82-92, 2016.

General Description

The important benefits of the ΔE₀₀ metric are often impaired by its complexity. By analyzing the ΔE₀₀ formula (presented above and described in detail in [3]), the high complexity of several of the terms is noticeable, resulting in a formula with a large computational cost. Hence, the use of this technique in many application scenarios is often unfeasible, particularly when the computational resources are more limited. Moreover, applications that need to perform multiple ΔE₀₀ calculations will be seriously affected with high computation times. As an example, consider two images with resolutions 720×480 and 1920×1080 pixels; in the former one will have to process 0.3×10⁶ pixels and in the latter 2.1×10⁶, resulting in much more calculations. The drawback of the computing cost of ΔE₀₀ becomes even more evident when considering video—with several images per second—and the increasingly penetrating 4K and 8K image resolutions. To overcome this problem and widen the applicability of this formula and its benefits to more scenarios, it is disclosed a method and device for a significantly faster decision on color similarity, while retaining the ΔE₀₀ benefits and capabilities.

To decrease the computation times, the disclosed method and device apply a set of filtering modules where simpler calculations are performed and an assessment is made: (1) the two input colors are different and no further calculations are needed; (2) a decision can not be made with certainty and further analysis is required. Generically, when comparing a pair of colors, these will be an input to the modules and ΔE ₀₀ will only be fully computed for pairs that may have higher perceptual similarity and did not had a decision made by the lighter weight modules. Hence, the number of times the full ΔE ₀₀ metric is calculated, and consequently the total number of operations required, is effectively reduced, resulting in lower processing times, while maintaining the same accuracy. This is supported by the fact that the expected outcome is not a precise distance measure, but a decision on the similarity or not of a pair of colors. Nevertheless, it is still necessary to identify and establish relations between the filtering modules and ΔE ₀₀ so that the results are equal to the ones obtained by only applying ΔE ₀₀, thus maintaining the metric benefits.

Colors are often represented in the RGB color space. This is particularly true when dealing with images, which are typically acquired in the RGB color space. Since the ΔE₀₀ metric makes use of the CIELAB color space, it often requires an additional color conversion step, resulting in extra calculations. It is advantageous for the filtering modules to avoid color space conversions as much as possible, more specifically, that they operate on the RGB color space. This space can be represented as a cube; hence, the difference between two colors can be seen as a difference vector inside the space. With this insight, disclosed method and device put forward three properties to be explored: the module of the difference vector between two colors; the angle between two color vectors; the lightness dissimilarity of the colors. Unlike the first two, the latter is not computed in the RGB space, requiring a color conversion (for example, converting to CIELAB lightness using CIELAB-CIEXYZ conversion and system values from standard ITU-R BT.709-6, as detailed below). Throughout the remainder of this document these properties will be referred to as Module, Angle and Lightness, respectively.

Given two colors in RGB, C₁=

r₁, g₁, b₁

and C₂=

r₂, g₂, b₂

, the Angle, Module and Lightness properties are calculated as follows:

$\begin{matrix} {{{Angle}\left( {C_{1},C_{2}} \right)} = {\arccos\left( \frac{C_{1} \cdot C_{2}}{{C_{1}} \times {C_{2}}} \right)}} & (29) \\ {{{Module}\left( {C_{1},C_{2}} \right)} = {{C_{2} - C_{1}}}} & (30) \\ {{{Lightness}\left( {C_{1},C_{2}} \right)} = {\Delta\; L}} & (31) \end{matrix}$

ΔL is given by the following equations,

$\begin{matrix} {C_{1^{''}} = \left( \begin{matrix} {{\left( \frac{C_{1^{\prime}} + 0.055}{1.055} \right)^{2.4} \times 100},} & {{{if}\mspace{14mu} C_{1^{\prime}}} > 0.04045} \\ {{{\frac{C_{1^{\prime}}}{12.92}*100},}\mspace{115mu}} & {{otherwise}\mspace{79mu}} \end{matrix} \right.} & (32) \\ {C_{2^{''}} = \left( \begin{matrix} {{\left( \frac{C_{2^{\prime}} + 0.055}{1.055} \right)^{2.4} \times 100},} & {{{if}\mspace{14mu} C_{2^{\prime}}} > 0.04045} \\ {{{\frac{C_{2^{\prime}}}{12.92}*100},}\mspace{115mu}} & {{otherwise}\mspace{79mu}} \end{matrix} \right.} & (33) \\ {Y_{1} = \frac{C_{1^{''}} \cdot \left\langle {0.2126,0.7152,0.0722} \right\rangle}{100}} & (34) \\ {Y_{2} = \frac{C_{2^{''}} \cdot \left\langle {0.2126,0.7152,0.0722} \right\rangle}{100}} & (35) \\ {Y_{1^{\prime}} = \left( \begin{matrix} {{Y_{1}^{\frac{1}{3}},}\mspace{146mu}} & {{{if}\mspace{14mu} Y_{1}} > 0.008856} \\ {{{7.787 \times Y_{1}} + \frac{16}{116}},} & {{otherwise}\mspace{79mu}} \end{matrix} \right.} & (36) \\ {Y_{2^{\prime}} = \left( \begin{matrix} {{Y_{2}^{\frac{1}{3}},}\mspace{146mu}} & {{{if}\mspace{14mu} Y_{2}} > 0.008856} \\ {{{7.787 \times Y_{2}} + \frac{16}{116}},} & {{otherwise}\mspace{79mu}} \end{matrix} \right.} & (37) \\ {{L\; 1} = {\left( {116 \times Y_{1^{\prime}}} \right) - 16}} & (38) \\ {{L\; 2} = {\left( {116 \times Y_{2^{\prime}}} \right) - 16}} & (39) \\ {{{\Delta\; L} = \left( {{L\; 2} - {L\; 1}} \right)},} & (40) \end{matrix}$

where C′₁ and C′₂ the normalized color vectors.

The calculations on equations 32 and 33 are performed on each component of the vectors and are here presented in a vectorized form. The referred properties have well defined limits: the angle between two color vectors (in the RGB color space) is limited between 0 and 90 degrees; the difference vector is limited by 0 as lower limit, if the vectors are equal, and 441.673 if they are on opposing vertices of the cube; the difference of lightness is limited by 0 and 100. The usage of these properties is justified by: (1) their simplicity, especially when compared to ΔE₀₀ as can be observed in equations 1 to 28; (2) their well defined limits.

If a certain maximum threshold of ΔE₀₀ is set, i.e., if we define a value of ΔE₀₀ above which two colors are considered to be perceptually different, then it is possible to reduce the number of calculations made for colors that are expected to give a color difference higher than the defined limit, by thresholding the Angle, Module and Lightness. Therefore, it is necessary to identify relations of Angle, Module and Lightness and the different outcomes of the ΔE₀₀ metric. To understand such relations and the variability of the many parameters of ΔE₀₀, a set of approximately 5 million colors were used and differences calculated using data from the images present in the Caltech 256 [1] dataset as basis pixels.

FIGS. 1, 2 and 3 depict the relation of ΔE₀₀ with Module, Angle and Lightness respectively. For each pair of colors, different ΔE₀₀ thresholds were considered, namely 3, 5 and 10. Color differences above the thresholds are represented in dark gray and in light gray otherwise. Moreover, the corresponding thresholds for Module, Angle and Luminance are represented by a horizontal line. It guarantees that all pairs whose ΔE₀₀ value is bellow the specified threshold are also below the Module, Angle and Lightness thresholds. As can be observed, for values below the horizontal line a confident decision based on the filtering modules can not be made and additional calculations are required. FIGS. 1, 2 and 3 show that for values of Module, Angle and Lightness above the horizontal line a decision can be accurately made on their dissimilarity, i.e., they can be classified as different using only the proposed filtering properties. Moreover, the graphics show that increasing the decision value defined for ΔE₀₀ requires higher values for the thresholds of Module, Angle and Lightness. Nevertheless, the number of color differences that can be filtered is always very significant. Note that ΔE₀₀ values above 7 are considered to represent clear color differences.

It is disclosed a method for color similarity evaluation between a pair of color, said method comprising the steps of:

-   -   calculating one or more filters from said pair of colors;     -   determining that the pair of colors are dissimilar if at least         one of the calculated filters is above a threshold predetermined         for each filter;     -   otherwise, calculating the CIEDE2000 color-difference ΔE₀₀ and         determining that the pair of colors are dissimilar if the         calculated CIEDE2000 color-difference ΔE₀₀ is above a         predetermined ΔE₀₀ threshold;     -   otherwise, determining that the pair of colors are similar.

In an embodiment, the one or more filters comprise a module filter wherein the calculation of said filter comprises calculating the module of the difference vector between the first and second colors represented as 3D coordinates in the RGB color space.

In an embodiment, the one or more filters comprise an angle filter wherein the calculation of said filter comprises calculating the angle between the two vectors of the first and second colors represented as 3D coordinates in the RGB color space.

In an embodiment, the one or more filters comprise a lightness filter wherein the calculation of said filter comprises calculating the lightness difference between the first and second colors, in particular the lightness difference between the first and second colors in the CIELAB color space.

In an embodiment, the one or more filters comprise a module filter and an angle filter.

In an embodiment, the one or more filters comprise a module filter and an angle filter, calculated in succession, thus calculating the angle filter after calculating the module filter.

In an embodiment, the one or more filters comprise a module filter, an angle filter and a lightness filter, calculated in succession, thus calculating the lightness filter after the angle filter, and calculating the angle filter after calculating the module filter.

In an embodiment, the one or more filters comprise a module filter, an angle filter and a lightness filter, calculated in parallel.

In an embodiment, the one or more filters comprise a module filter, an angle filter and a lightness filter, calculated in parallel and the calculation of the one or more filters is interrupted when at least one of the calculated filters is above a threshold predetermined for said one filter.

In an embodiment, the threshold predetermined for each filter is pre-obtained from the ΔE₀₀ threshold.

In an embodiment, the threshold predetermined for the lightness filter is pre-obtained from the ΔE₀₀ threshold and a using a linear regression.

In an embodiment, the threshold predetermined for the module filter and/or the threshold predetermined for the angle filter is pre-obtained from the ΔE₀₀ threshold using a machine learning algorithm, in particular using a random forest algorithm.

It is also disclosed a non-transitory storage media including program instructions for implementing a color similarity evaluation device, the program instructions including instructions executable to carry out any of the disclosed methods.

It is also disclosed a color similarity evaluation device comprising said non-transitory storage media according and a data processor arranged for executing said instructions.

It is also disclosed a color similarity evaluation device arranged to carry out the steps of any of the disclosed methods.

BRIEF DESCRIPTION OF THE DRAWINGS

The following figures provide preferred embodiments for illustrating the description and should not be seen as limiting the scope of invention.

FIG. 1: Schematic representation of relationships between results of color differences using ΔE₀₀ and the corresponding value obtained by Module. In dark gray ΔE₀₀ values above the threshold and in light gray values below or equal to the threshold. The horizontal line represents a suggested threshold for Module.

FIG. 2: Schematic representation of relationships between results of color differences using ΔE₀₀ and the corresponding value obtained by Angle. In dark gray ΔE₀₀ values above the threshold and in light gray values below or equal to the threshold. The horizontal line represents a suggested threshold for Angle.

FIG. 3: Schematic representation of relationships between results of color differences using ΔE₀₀ and the corresponding value obtained by Lightness. In dark gray ΔE₀₀ values above the threshold and in light gray values below or equal to the threshold. The horizontal line represents a suggested threshold for Lightness.

FIG. 4: Schematic representation of the Module, Angle and Lightness thresholds for each ΔE00 threshold.

FIG. 5: Schematic representation of a comparison between optimal and predicted thresholds relation of Module, Angle and Lightness with regards to the ΔE₀₀ threshold.

FIG. 6: Schematic representation of histogram of color differences that can by filtered by each module.

FIG. 7: Schematic representation of block diagram of the cascade embodiment.

FIG. 8: Schematic representation of block diagram of the parallel embodiment.

FIG. 9: Schematic representation of the processing time for the different strategies, considering two decision thresholds (vertical lines). FIG. 9(a) concerns serial processing of the pixels in an image and FIG. 9(b) concerns the parallel processing. For example, when applying T_(D1) the decision is made by module M₁, while for T_(D2) only module M₃ can make a decision.

FIG. 10: Schematic representation of image processing possibilities taking advantage of CPUs with multiple cores. The Fast Color Decision (FCD) module represents one of the two proposed strategies.

DETAILED DESCRIPTION

The thresholds indicated in FIGS. 1 through 3 are only valid for ΔE₀₀ values of 3, 5 and 10. For other values of the metric, new thresholds may be identified. Models were derived for Module, Angle and Lightness to avoid empirical setting of these thresholds. These were obtained by training regression models using data derived from the 5 million calculated color differences. For the dataset, results and thresholds were computed for ΔE₀₀ E {0,30} with a step of 0.05. These values were selected because colors with 0 color difference are visibly imperceptible and with 30 are extremely different. The obtained thresholds relations are presented in FIG. 4. It is possible to observe that the relations for Module and Angle are nonlinear, but are approximately linear for Lightness. To obtain the models for the properties and validate our approach, we chose to train a random forest [2] for Module and Angle and a linear regression for Lightness. The models were trained using a cross-validation approach and the best fitting models obtained root mean square errors of 0.00675, 0.0333 and 0.00602 for Angle, Module and Lightness, respectively. Ideally these errors should be as closer to 0 as possible but, for the scope of this disclosure, the obtained errors are considered acceptable since the data used for training was already regularized.

This regularization was introduced in the training data as to shift the predicted values so that the possible errors do not influence the final decision. While this translates into predicted thresholds different from the optimal values, it is guaranteed that they are always above the corresponding optimal values and thus always applicable. This translates into a performance deterioration, while assuring corrected predictions. Comparison of predicted thresholds using regularized and non-regularized data are shown in FIG. 5, where the black lines correspond to the regularized predicted thresholds and the dotted lines correspond to the non-regularized data. Analysing the plots it is clear that, on the universe of values studied, the predictions are always offsetted.

With the derived models it is possible to obtain, for any ΔE₀₀ value, thresholds for Module, Angle and Lightness so that any two colors whose difference surpasses those thresholds can be classified as having a ΔE₀₀ color difference higher than the specified value. This is very advantageous as it can be mapped into a structure that efficiently cuts calculations, resulting in a significant performance gain without jeopardizing ΔE₀₀ properties. Each threshold can be used to reduce the amount of ΔE₀₀ calculations necessary for a given application that sets a limit for ΔE₀₀. However, the color combinations that each threshold cuts are not the same. FIG. 6 depicts an histogram of the number of color differences that can be filtered by each module for the three ΔE₀₀ values previously considered. The histograms show that a very reduced number of color differences can be exclusively filtered exclusively by Module, Angle or Lightness. Even though this number increases with the ΔE₀₀ threshold, it remains very low. It is also clear that a very large number of color differences can be filtered by combining Module, Angle or Lightness. This number varies inversely to the ΔE₀₀ threshold and the decrease is compensated by the augment of the differences filtered by only two of the properties, especially Module-Lightness and Module-Angle, but also those that can be decided upon only by calculating the full ΔE₀₀ metric. Hence, different strategies can be defined towards an efficient validation of whether its necessary to compute the full color difference formula or not. A set of possible embodiments is proposed and discussed below.

Based on the concepts and relations described, different strategies can be conceived towards a faster decision of color similarity based on the ΔE₀₀ metric. In this section, two embodiments are put forward and discussed: (1) filtering models deployed in cascade (i.e. calculated in succession); (2) filtering models deployed in parallel. Moreover, it is discussed an embodiment applicable to large arrays of color differences to be computed, namely in image processing, where the initial proposals for color difference calculation can be used, specifically taking advantage of the widely spread multi-core hardware.

The first proposed strategy for efficient ΔE₀₀-based color decision consists of deploying the filtering modules in a cascade (i.e. calculated in succession), as illustrated in FIG. 7. In each module of the cascade, simpler calculations are performed to compute Module, Angle or Lightness and an assessment is made. The full ΔE₀₀ metric is only computed as last resource; hence, it will always be the last module of the cascade.

Each module of the cascade is intended to make a decision: if colors are different then a cascade output is made; or, uncertainty exists and processing is passed to the next module of the cascade. Hence, we can expect that it is desirable to have faster modules, with smaller computation weight, executed first, preferably pruning as much pixels as possible. Nevertheless, determining the most adequate cascade structure, i.e., to identify the order of the operations, is not necessarily defined by speed of execution. It is important to note that the cascade structure may be dependent on the hardware architecture. Moreover, the value of the ΔE₀₀ threshold to be considered may influence the best cascade structure. Hence, optimized embodiments are described further below.

The cascade approach aims to sequentially perform operations that prune the number of color pairs requiring the calculation of ΔE₀₀. As initial blocks of the cascade are unable to decide on color dissimilarity and ultimately ΔE₀₀ must be calculated, the total number of calculations would in fact be greater than just for the ΔE₀₀ calculation. Hence, the benefits of the cascade strategy derive from a greater number of colors being filtered by earlier blocks.

An alternative strategy to the cascade is proposed, were the different blocks are executed in parallel, as illustrated by the block diagram of FIG. 8. The underlying hypothesis is that ,in this case, the maximum time for analysing a color difference does not exceed the ΔE₀₀ time. While this may not be exactly true due to synchronization and management overhead, this difference can be considered almost negligible. These embodiments for the cascade and parallel cases are illustrated in FIG. 9(a) and FIG. 9(b) respectively. Obviously, the advantage of the parallel strategy is directly related to the availability of parallel execution means, e.g. the number of available CPU cores.

While this approach is sound, its implementation is not as straightforward as the cascade strategy. In fact, several implementation details must be taken into account under the penalty of jeopardizing possible gains.

The strategies described are generic for a decision on color similarity. As previously stated, the benefits of the parallel strategy are more evident when multiple core CPUs can be used and the processing distributed.

When a large array of colors, for example an image, is to be processed, i.e., compared to one or more reference colors, this data can be sequentially processed. In this case, each color would be individually and sequentially passed as input along with the reference color and the desired threshold. In other words, one pair of colors at a time. This is illustrated in FIG. 10(a). The calculation of the color difference itself could be made through any of the strategies described in the previous sub-sections. When multiple cores are available, the data to be processed can be divided and each of these blocks passed as input for processing as illustrated in FIG. 10(b).

The order of the blocks in the cascade strategy (i.e. the order in which they are calculated in succession) influences the outcome of the overall process, more specifically the time reduction that can be obtained when compared to the calculation of the ΔE₀₀ metric. The ϕE₀₀ block will be the last of the cascade, but it is still necessary to identify what the remaining blocks should be and their order. Given the three properties put forward, there are 15 possible cascade structures as identified in Table 1. Each of these possibilities performs different pruning on the color differences. Moreover, the complexity of the cascade will depend on the restrictions imposed, namely the required ΔE₀₀ decision threshold.

TABLE 1 Identification of possible cascade structures. Even though it is not represented, the ΔE₀₀ block will always be the last module of the cascade. Order in cascade # 1 2 3 ID 1 Module X X M 2 Angle X X A 3 Lightness X X L 4 Module Angle X MA 5 Module Lightness X ML 6 Angle Module X AM 7 Angle Lightness X AL 8 Lightness Angle X LA 9 Lightness Module X LM 10 Module Angle Lightness MAL 11 Module Lightness Angle MLA 12 Angle Lightness Module ALM 13 Angle Module Lightness AML 14 Lightness Module Angle LMA 15 Lightness Angle Module LAM

To evaluate the cascade possibilities we implemented a simple segmentation algorithm that, given an image, a color and a ΔE₀₀ threshold, produces a new image that highlights regions where the colors are bellow the specified threshold. Each structure was assessed using a bank of generic colors as specified in [5] and images from the Caltech 256 dataset [1]. A subset of 4K resolution images from the RAISE dataset [6] and a small set of 8K computer generated images were also used. Each instance of the color bank was compared with the color of each pixel of the images of the three subsets. Moreover, the evaluation was performed in three different computer architectures to understand the impact over the cascade structure. Specifically, the following architectures were used: (1) a desktop computer equipped with an Intel i7 4471 processor @ 3.5 Ghz ; (2) a Raspberry Pi 2 Model B; (3) a Samsung Galaxy S6 smartphone. The algorithms were implemented in C++ for the first two environments and in Java for the smartphone. In these experiments no explicit GPU acceleration was used and the CPU time and cycles allocated the process were measured.

The results presented in Table 2 clearly show the advantage of the cascade approach in alternative to the full computation of the ΔE₀₀ formula for a dekstop computer. Independently of the filtering blocks—Module, Angle or Luminance—their order and the underlying ΔE₀₀ threshold, the cascade strategy always achieved significant gains in performance. This is true when measuring processing time as well as CPU cycles. Since there is a clear relation between the number of CPU cycles and the overall processing time, in the following results CPU cycles will only be presented when justified to convey additional information.

The increase of the ΔE₀₀ threshold implies some changes in the ranking and the overall gain decreases. Nevertheless, the time reductions enabled by the cascade strategy remain very significant (above 70%) and the results show a consistency of the cascade structure. Even though there are some changes in the ranking, namely LMA-LAM and M-ML, the differences in the relative gain are almost negligible. The results show that overall greater gains are achieved when Module is the first bock of the cascade. This is consistent with the fact that: (1) it is a lightweight operation; (2) it does not require a color conversion; (3) it enables the filtering of a large number of color differences as can be observed in FIG. 1. This is particularly true for a ΔE₀₀ threshold of 3 (Table 2) where the best results were obtained for a cascade with only the Module filtering block. While Module as a filtering block provides by itself large computation gains, overall better results were obtained by adding other blocks; this is due to the simplicity of the formulas when compared to ΔE₀₀ and is indicative of some filtering complementarity between Module, Angle and Luminance as shown by the histograms in FIG. 6. As expected, the use of Luminance as the first block results in smaller temporal gains, namely due to the more complex formulation (when compared to Module and Angle) and the need for a color space conversion. It is also interesting to note that the larger gain is obtain with the combination Module-Angle; the addition of Luminance as the third block results in a slightly smaller gain.

The results of the experiments on a Raspberry Pi 2 Model B are consistent with the results obtained in a desktop computer, with relative gains of the same order, despite the more limited resources. Also, as with the desktop computer, there are some modification in the ranking of the cascade structure that are due to almost negligible differences in the relative gain. It is noteworthy the fact that, as in the desktop case, Module has a high impact and for ΔE_(oo)=3 it provides the best result by itself.

The rankings for Android present some differences with regards to the previous cases, especially with desktop, with the ranking starting with MA being followed by AM, M or AML, or starting with AML and being followed by MAL, AM, etc. Nevertheless, the gains are very significant and only slightly lower (between 65% and 89%) than in the previous cases. To this undoubtedly contributes the differences in the computer architectures, but also the requirements imposed on the implementation languages. For desktop and Raspberry the blocks were implemented in C++ and for Android, Java was used.

TABLE 2 Cascade performance on a desktop computer for a ΔE₀₀ = 3 for the Caltech 256 dataset. Results are ordered inversely to their computation cost. ΔE₀₀ = 3 Cascade Time CPU Time Cycles Structure (sec) Cycles Reduction Reduction ΔE₀₀ 2121.82 7.427E+12 — — L 1319.91 4.617E+12 −37.79% −37.83% LA 1166.08 4.080E+12 −45.04% −45.07% LAM 1134.08 3.967E+12 −46.55% −46.58% LM 1129.93 3.953E+12 −46.75% −46.77% LMA 1129.67 3.952E+12 −46.76% −46.78% A 712.254 2.492E+12 −66.43% −66.45% AL 462.746 1.619E+12 −78.19% −78.20% AML 429.642 l.503E+12 −79.75% −79.76% ALM 98.578 3.450E+11 −95.35% −95.35% AM 87.064 3.047E+11 −95.90% −95.90% MAL 58.111 2.034E+11 −97.26% −97.26% MLA 58.094 2.034E+11 −97.26% −97.26% ML 57.502 2.014E+11 −97.29% −97.29% MA 46.706 1.634E+11 −97.80% −97.80% M 45.911 1.607E+11 −97.84% −97.84%

The proposed embodiments enabled very significant gains in all the hardware platforms used. Slightly lower gains were obtain when using Android, to which are not agnostic not only the platform differences, but also the implementation language itself. Nevertheless, the differences in the relative gain are minimal. Even though the gains have a dependance on the desired decision boundary on the result of ΔE₀₀, they are very high for useful values of the metric; larger values of ΔE₀₀ will have decreasingly lower entropy with values greater than 7 considered to represent two very different colors.

The best structure for the cascade strategy presented slight variations, but overall a small set of possibilities can be identified, to be used horizontally with very small decreases in the relative gain. Specifically, for execution on a desktop computer, it is possible to identify the structure comprised of the filtering blocks Module-Angle followed by the ΔE₀₀ calculation block as providing the best results or just slightly bellow. These same conclusions can be applied to the Raspberry Pi and Smartphone cases. As previously, the structure comprised of the filtering blocks Module-Angle followed by the ΔE₀₀ block can be identified as a good compromise for a structure that can be applied independently of the range of target ΔE₀₀ values. For these two cases, the identified cascade structure does not only provide the best result more often, but the differences are nevertheless very small.

While values of ΔE₀₀ above 10 are not considered, it should be noted that colors with ΔE₀₀ distance above this value are considered to be notably different. Nevertheless, the knowledge resulting from the reported analysis and proposed models (see FIG. 4) enables the implementation of the cascade in a way that it can adapt it self to different decision thresholds and hardware platforms known a priori and given a context passed as input.

The filtering properties analysed—Module, Angle and Lightness—enabled very high processing gains using different strategies and hardware platforms. Nevertheless, other properties can be analysed and their benefits studied. Moreover, it is possible to use a hybrid strategy combining the cascade and parallel strategy.

The term “comprising” whenever used in this document is intended to indicate the presence of stated features, integers, steps, components, but not to preclude the presence or addition of one or more other features, integers, steps, components or groups thereof. Flow diagrams of particular embodiments of the presently disclosed methods are depicted in figures. The flow diagrams do not depict any particular means, rather the flow diagrams illustrate the functional information one of ordinary skill in the art requires to perform said methods required in accordance with the present disclosure. It will be appreciated by those of ordinary skill in the art that unless otherwise indicated herein, the particular sequence of steps described is illustrative only and can be varied without departing from the disclosure. Thus, unless otherwise stated the steps described are so unordered meaning that, when possible, the steps can be performed in any convenient or desirable order.

It is to be appreciated that certain embodiments of the disclosure as described herein may be incorporated as code (e.g., a software algorithm or program) residing in firmware and/or on computer useable medium having control logic for enabling execution on a computer system having a computer processor, such as any of the servers described herein. Such a computer system typically includes memory storage configured to provide output from execution of the code which configures a processor in accordance with the execution. The code can be arranged as firmware or software, and can be organized as a set of modules, including the various modules and algorithms described herein, such as discrete code modules, function calls, procedure calls or objects in an object-oriented programming environment. If implemented using modules, the code can comprise a single module or a plurality of modules that operate in cooperation with one another to configure the machine in which it is executed to perform the associated functions, as described herein.

The disclosure should not be seen in any way restricted to the embodiments described and a person with ordinary skill in the art will foresee many possibilities to modifications thereof. The above described embodiments are combinable. The following claims further set out particular embodiments of the disclosure. 

1. A method for color similarity evaluation between a first and a second color, comprising the steps of: calculating one or more color-difference filters over said first and second colors; determining that the first and second colors are dissimilar if at least one of the one or more calculated filters is above a threshold predetermined for each of the one or more calculated filters; otherwise, calculating the CIEDE2000 color-difference ΔE₀₀ and determining that the first and second colors are dissimilar if the calculated CIEDE2000 color-difference ΔE₀₀ is above a predetermined ΔE₀₀ threshold; and otherwise, determining that the first and second colors are similar.
 2. The method according to claim 1, wherein the one or more filters comprise a module filter wherein the calculation of said filter comprises calculating the module of the difference vector between the first and second colors represented as 3D coordinates in the RGB color space.
 3. The method according to claim 1, wherein the one or more filters comprise an angle filter and wherein the calculation of said filter comprises calculating the angle between the two vectors of the first and second colors represented as 3D coordinates in the RGB color space.
 4. The method according to claim 1, wherein the one or more filters comprise a lightness filter and wherein the calculation of said filter comprises calculating the lightness difference between the first and second colors.
 5. The method according to claim 2, wherein the one or more filters comprise a module filter and an angle filter.
 6. The method according to claim 2, wherein the one or more filters comprise a module filter and an angle filter, calculated in succession, thereby calculating the angle filter after calculating the module filter.
 7. The method according to claim 2, wherein the one or more filters comprise a module filter, an angle filter and a lightness filter, calculated in succession, thereby calculating the lightness filter after the angle filter, and calculating the angle filter after calculating the module filter.
 8. The method according to claim 2, wherein the one or more filters comprise a module filter, an angle filter and a lightness filter, calculated in parallel.
 9. The method according to claim 8, wherein the one or more filters comprise a module filter, an angle filter and a lightness filter, calculated in parallel such that the calculating of the one or more filters is interrupted when at least one of the calculated filters is above a threshold predetermined for said one filter.
 10. The method according to claim 1, wherein the threshold predetermined for each filter is pre-obtained from the ΔE₀₀ threshold.
 11. The method according to claim 10, wherein the threshold predetermined for the lightness filter is pre-obtained from the ΔE₀₀ threshold using a linear regression.
 12. The method according to claim 10, wherein the threshold predetermined for the module filter and/or the threshold predetermined for the angle filter is pre-obtained from the ΔE₀₀ threshold using a machine learning algorithm.
 13. The method according to claim 1, further comprising splitting the color data to be evaluated in two or more data sets and evaluating in parallel said split data sets for color similarity.
 14. A non-transitory storage media including program instructions for implementing a color similarity evaluation device, the program instructions including instructions executable to carry out the method of claim
 1. 15. (canceled)
 16. A color similarity evaluation device arranged to carry out the steps of the method of claim
 1. 